1 <table height="28" cellSpacing="0" cellPadding="0" width="100%" border="0">
2       <tr align=center>
3         <td
class="title" width="100%">Hình &#7843;nh : <a href="./?act=album_image_m&page=<? echo $_REQUEST['page']; ?>&cat=<? echo $_REQUEST['cat']; ?>"><font class="V10pt" color="#ffffff">Nh&#7853;p M&#7899;i</font></a>&nbsp;&nbsp;
4     </td>
5       </tr>
6     </table>
7 <?
8     
switch ($_GET['action'])
9     {
10         
case 'del' :
11             $id = $_GET[
'id'];
12             $sql=
"select * from album_images where album_images_id=$id limit 1";
13             $pro=mysql_fetch_assoc(mysql_query($sql,$con));
14             
if ($pro)
15             {
16                 $sql =
"delete from album_images where album_images_id='".$id."'";
17                 $result = mysql_query($sql,$con);
18                 
if ($result)
19                 {
20                     
if (file_exists($pro['album_images_img'])) unlink($pro['album_images_img']);
21                     
if (file_exists($pro['album_images_imglarge'])) unlink($pro['album_images_imglarge']);
22                     echo
"<p align=center class='err'>&#272;ã xóa thành công</p>";
23                 }
24                     
else echo "<p align=center class='err'>Không th&#7875; xóa d&#7919; li&#7879;u</p>";
25             }
26             
break;
27     }
28 ?>
29
30 <?
31     
if (isset($_POST['ButDel'])) {
32         $cnt=
0;
33         
foreach ($_POST['chk'] as $id)
34         {
35             $sql=
"select * from album_images where album_images_id=$id limit 1";
36             $pro=mysql_fetch_assoc(mysql_query($sql,$con));
37             
if ($pro)
38             {
39                 @$result = mysql_query(
"delete from album_images where album_images_id='".$id."'",$con);
40                 
if ($result) {
41                     $cnt++;
42                     
if (file_exists($pro['album_images_img'])) unlink($pro['album_images_img']);
43                     
if (file_exists($pro['album_images_imglarge'])) unlink($pro['album_images_imglarge']);
44                 }
45             }
46         }
47         echo
"<p align=center class='err'>&#272;ã xóa ".$cnt." ph&#7847;n t&#7917;</p>";
48     }
49 ?>
50
51 <?
52     $page = $_GET[
"page"];
53     $MAXPAGE=
10;
54     $p=
0;
55     
if ($page!='') $p=$page;
56     $
where="1=1";
57     
//if ($_REQUEST['status']!='') $where="products_status=".$_REQUEST['status']." ";
58     
if ($_REQUEST['cat']!='') $where="album_images_categoriesid=".$_REQUEST['cat'];
59
60 ?>
61 <form method=
"POST" name="frmList" action="index.php">
62 <input type=
"hidden" name="act" value="album_image">
63 <input type=hidden name=
"page" value="<? echo $page; ?>">
64 <?
65 function taotrang($total,$link,$nitem,$itemcurrent,$step=
10)
66 {
global $con;
67     $ret=
"";
68     
69     $param=
"";
70     $pages=count_page($total,$nitem);
71     
if ($itemcurrent>0) $ret.='<a title="&#272;&#7847;u tiên" href="'.$link.'0" class="lslink">[&lt;]</a> ';
72     
if ($itemcurrent>1) $ret.='<a title="V&#7873; tr&#432;&#7899;c" href="'.$link.($itemcurrent-1).'" class="lslink">[&lt;&lt;]</a> ';
73     $
from=($itemcurrent-$step>0?$itemcurrent-$step:0);
74     $to=($itemcurrent+$step<$pages?$itemcurrent+$step:$pages);
75     
for ($i=$from;$i<$to;$i++)
76     {
77         
if ($i!=$itemcurrent) $ret.='<a href="'.$link.$i.'" class="lslink">'.($i+1).'</a> ';
78         
else $ret.='<b>'.($i+1).'</b> ';
79     }
80     
if (($itemcurrent<$pages-2) && ($pages>1)) $ret.='<a title="Ti&#7871;p theo" href="'.$link.($itemcurrent+1).'">[&gt;&gt;]</a> ';
81     
if ($itemcurrent<$pages-1) $ret.='<a title="Cu&#7889;i cùng" href="'.$link.($pages-1).'">[&gt;]</a>';
82     
return $ret;
83 }
84
85     $pageindex=taotrang(CountRecord(
"album_images",$where),"./?act=album_image&cat=".$_REQUEST['cat']."&page=",$MAXPAGE,$page);
86 ?>
87
88 <table cellspacing=
"0" cellpadding="0" width="100%">
89 <?
if ($_REQUEST['code']==1) echo '<tr><td align="center" class="err">&#272;ã c&#7853;p nh&#7853;t thành công</td></tr>'; ?>
90 <tr>
91 <td
class="smallfont">Trang : <? echo $pageindex; ?></td>
92 <td height=
"30" align="right" class="smallfont">
93     <
select size="1" name="ddCat" class="smallfont">
94 <?
95     $ms=GetListProduct();
96     echo
'<option value="">[T&#7845;t c&#7843;]</option>';
97     
foreach ($ms as $m)
98         
if ($m[0]!=$_REQUEST['cat'])
99             echo
'<option value="'.$m[0].'">'.$m[1].'</option>';
100         
else
101             echo
'<option selected value="'.$m[0].'">'.$m[1].'</option>';
102 ?>
103     </
select>
104     <input type=
"button" value="Chuy&#7875;n" class="button" onclick="window.location='./?act=album_image&cat='+ddCat.value">
105     </td>
106
107 </tr>
108 </table>
109
110 <table border=
"1" cellpadding="2" style="border-collapse: collapse" bordercolor="#C9C9C9" width="100%" id="AutoNumber1">
111   <tr>
112     <td align=center nowrap
class="title"><input type="checkbox" name="chkall" onclick="chkallClick(this);"></td>
113     <td colspan=
"2" nowrap class="title">&nbsp;</td>
114     <td align=
"center" nowrap class="title"><b>Mã</b></td>
115     <td align=
"center" nowrap class="title"><b>Tên</b></td>
116     <td align=
"center" nowrap class="title"><b>Mô t&#7843;</b></td>
117     <td align=
"center" nowrap class="title"><b>Hình nh&#7887;</b></td>
118     <td align=
"center" nowrap class="title"><b>Hình l&#7899;n</b></td>
119     <td align=
"center" nowrap class="title"><b>Không hi&#7879;n</b></td>
120     <td align=
"center" nowrap class="title"><b>S&#7889; l&#432;&#7907;t xem</b></td>
121     <td align=
"center" nowrap class="title"><b>S&#7889; l&#432;&#7907;t download</b></td>
122     <td align=
"center" nowrap class="title"><b>Ngày</b></td>
123   </tr>
124   
125   <?php
126             $sql=
"select * from album_images where $where order by album_images_id limit ".($p*$MAXPAGE).",".$MAXPAGE;
127             $result=mysql_query($sql,$con);
128             $i=
0;
129             
while(($row=mysql_fetch_array($result)))
130             {
131             $i++;
132             
if ($i%2) $color="#d5d5d5"; else $color="#e5e5e5";
133   ?>
134   
135   <tr>
136     <td align=
"center" bgcolor="<? echo $color; ?>" class="smallfont">
137     <input type=
"checkbox" name="chk[]" value="<? echo $row['album_images_id']; ?>"></td>
138     <td align=
"center" bgcolor="<? echo $color; ?>" class="smallfont">
139     <a href=
"./?act=album_image_m&cat=<? echo $_REQUEST['cat']; ?>&id=<? echo $row['album_images_id']; ?>&page=<? echo $_REQUEST['page'];?>">
140     S&#
7917;a</a></td>
141     <td align=
"center" bgcolor="<? echo $color; ?>" class="smallfont">
142     <a href=
"./?act=album_image&cat=<? echo $_REQUEST['cat']; ?>&page=<? echo $_REQUEST['page']; ?>&action=del&id=<? echo $row['album_images_id']; ?>">
143     Xoá</a></td>
144     <td bgcolor=
"<? echo $color; ?>" align="left" align="left" class="smallfont"><? echo $row['album_images_id']; ?>&nbsp;</td>
145     <td bgcolor=
"<? echo $color; ?>" class="smallfont"><? echo $row['album_images_name']; ?>&nbsp;</td>
146     <td bgcolor=
"<? echo $color; ?>" class="smallfont"><? //echo $row['album_images_description']; ?>&nbsp;</td>
147     <td bgcolor=
"<? echo $color; ?>" class="smallfont"><? echo $row['album_images_img']; ?>&nbsp;</td>
148     <td bgcolor=
"<? echo $color; ?>" class="smallfont"><? echo $row['album_images_imglarge']; ?>&nbsp;</td>
149     <td bgcolor=
"<? echo $color; ?>" class="smallfont"><? echo $row['album_images_status']; ?>&nbsp;</td>
150     <td bgcolor=
"<? echo $color; ?>" class="smallfont"><? echo $row['album_images_view']; ?>&nbsp;</td>
151     <td bgcolor=
"<? echo $color; ?>" class="smallfont"><? echo $row['album_images_download']; ?>&nbsp;</td>
152     <td bgcolor=
"<? echo $color; ?>" class="smallfont"><? echo $row['album_images_date_added']; ?>&nbsp;</td>
153   </tr>
154   <?
155                 }
156   ?>
157 </table>
158 <input type=
"submit" value="Xóa Ch&#7885;n" name="ButDel" onclick="return confirm('B&#7841;n có ch&#7855;c ch&#7855;n mu&#7889;n xoá ?');" class="button">
159 </form>
160 <script language=
"JavaScript">
161 function chkallClick(o) {
162     
var form = document.frmList;
163     
for (var i = 0; i < form.elements.length; i++) {
164         
if (form.elements[i].type == "checkbox" && form.elements[i].name!="chkall") {
165             form.elements[i].
checked = document.frmList.chkall.checked;
166         }
167     }
168 }
169 </script>



Full source code website bán hàng thương mại điện tử gần giống shopee 468.967 lượt xem

Gõ tìm kiếm nhanh...